// 表单数据处理
import tab from "@/plugins/tab.js";
const form = {
  state: {
    // 弹出层显示状态
    popUpShow: false,
    // 单选-状态数据
    statusRadioList: [
      {
        showName: "正常",
        name: "0",
        disabled: false,
      },
      {
        showName: "禁用",
        name: "1",
        disabled: false,
      },
    ],
    // 单选-性别数据
    sexRadioList: [
      {
        name: "男",
        disabled: false,
      },
      {
        name: "女",
        disabled: false,
      },
    ],
    // 单选- 系统内置 数据
    systemRadioList: [
      {
        showName: "是",
        name: "Y",
        disabled: false,
      },
      {
        showName: "否",
        name: "N",
        disabled: false,
      },
    ],
    // 单选- 公告类型数据 数据
    typeRadioList: [
      {
        showName: "通知",
        name: "1",
        disabled: false,
      },
      {
        showName: "公告",
        name: "2",
        disabled: false,
      },
    ],
    // 日期范围
    dateRange: [],
    // 请求列表
    totalList: [],
  },
  mutations: {
    // 同步列表
    syncGetList(state, list) {
      state.totalList = list;
    },
    /** 添加用户跳转页面 */
    handleAdd(state, addPageTitle) {
      tab.navigateTo(
        "/pages/work/userControl/CorU-User/index?title=" + addPageTitle
      );
    },
    /** 触发搜索栏点击事件(打开弹出层) */
    popupState(state, visibility) {
      state.popUpShow = visibility;
    },
  },
};

export default form;
